from django.shortcuts import render
from blog.models import BlogPost
from updater.movie_info_updater import MovieInfoUpdater


def archive(request):
    posts = BlogPost.objects.all()
    return render(request, "archive.html", {"posts": posts})


def movie_info(request):
    updater = MovieInfoUpdater()
    result = updater.fetch_top250()
    return render(request, "top250.html", {"movies": result['subjects']})
